<% @user.password = @user.password_confirmation = nil
	user_form = form_second 
%>

<%= error_messages_for :user %>
<%= error_messages_for :photo %>
<% form_for :user, :html => { :multipart => true, :id => "user_form" }, :url => users_path do |review_form| -%>
<table>
	<tr>
  	<td class="label_cell_form"><%= label_tag "user_max_distance", User.human_attribute_name("max_distance") %></td>
  	<td class="label_input_form"><%= user_form.select :max_distance, [["20km", 20], ["50km", 50], ["100km", 100]] %></td>
	</tr>
	<tr>
  	<td class="label_cell_form"><%= label_tag "user_alias", Core.human_attribute_name("alias") %></td>
  	<td class="label_input_form"><span style="margin-right:5px;">http://nerto.it/</span><%= user_form.text_field :alias %></td>
	</tr>
	<tr>
		<td class="label_cell_form"></td>
		<td class="label_input_form"><div id="existing_places_div"></div></td> 
	</tr>
	<tr>
	  <td class="label_cell_form"><%= label_tag "user_colors", Core.human_attribute_name("colors") %></td>
  	<td class="label_input_form"><%= user_form.select :colors, [["viola", "28004d"], ["Quasi nero", "333333"], ["Ocra", "999900"], 
						 ["Verdino", "99CC33"], ["Mezzo rosa mezzo rosso", "FA1E42"], 
						 ["Blu chiaro", "0386A7"], ["Giallo", "D6F000"], ["Grigio", "B4B4B4"]] %>
		</td>
	</tr>
	<tr>
		<td class="label_cell_form"><%= label_tag "user_sites", Core.human_attribute_name("sites") %></td>
  	<td class="label_input_form">
  		<% sites = @user.sites.to_s.split(" , ") %>  		
			<div>
				<%= text_field_tag "user[site][]", sites.delete_at(0), :size => 30 %>
				<a rel="user" href="#" class="more_site_lnk mini_button_form" ><%=t "core.more_sites" %></a>
				<%= a = ""; sites.each{ |i| a += "<br />" + text_field_tag("user[site][]",i)}; a; %>
			</div>  		
		</td>
	</tr>
	<tr>
		<td class="label_cell_form"><%= label_tag "user_description", Core.human_attribute_name("description") %></td>
		<td class="label_input_form"><%= user_form.text_area :description, :rows => 5 %></td>
	</tr>
	<tr>
		<td class="label_cell_form"><%= label_tag "user_newsletter", User.human_attribute_name("newsletter") %></td>
		<td class="label_input_form"><%= user_form.check_box :newsletter %></td>
	</tr>
	<tr>
		<td class="label_cell_form"><%= label_tag "user.notify_public_messages", User.human_attribute_name("notify_public_messages") %></td>
		<td class="label_input_form"><%= user_form.check_box :notify_public_messages %></td>
	</tr>
	<tr>
		<td class="label_cell_form"><%= label_tag "user.notify_private_messages", User.human_attribute_name("notify_private_messages") %></td>
		<td class="label_input_form"><%= user_form.check_box :notify_private_messages %></td>
	</tr>
	<tr>
		<td class="label_cell_form"><%= label_tag "user.notify_bookmark_events", User.human_attribute_name("notify_bookmark_events") %></td>
		<td class="label_input_form"><%= user_form.check_box :notify_bookmark_events  %></td>
	</tr>
	<tr>
  	<td class="label_cell_form"><%= label_tag "user_back_img", User.human_attribute_name("back_img") %></td>
  	<td class="label_input_form"><%= user_form.select :back_img, [["img1", "img1.gif"], ["img2", "img2.gif"]] %></td>
	</tr>
	<tr>
		<td class="label_cell_form"><%= label_tag "user_banner", User.human_attribute_name("banner") %></td>
		<td class="label_input_form">
				<%= user_form.file_field :banner %>												
				<%= image_tag(@user.banner_url) if @user.banner_url %>				
		</td>
	</tr>
	<tr>
  	<td class="label_cell_form"></td>
  	<td class="label_input_form"><%= submit_tag I18n.t(@user.id ? 'user.edit_button' : 'user.sign_up_button'), :class => "button_form" %></td>
	</tr>
</table>	

<% end -%>
